Re: str_dup, CREATE(), et al

From: Akuma/Chris Baggett/DOOMer (doomer@BAYOU.COM)
Date: 03/15/98


The char_data structure is that same as it always was.
many things added, but nothing removed, all I did
was make load_char (i have ASCII pfiles) accept
a char_data structure instead of a char_file_u structure.

anyway, memory correct means, (my definition)
Any memory you CREATE() you also remember to FREE().

I was thinking of changing load_char to return a pointer to
a char_data structre like so.

struct char_data *load_char(char *name);

would that solve the memory allocation error? or would it
just not help at all?

Thanks for the insight.

Akuma the Raging Coder


At 02:46 PM 3/15/98 -0800, you wrote:
>On Sun, 15 Mar 1998, Akuma/Chris Baggett/DOOMer wrote:
>
>->what i've done is convert load_char() to accept
>->char_data structure instead of char_file_u (thus eliminating them).
>->but a problem i had was that load_char required char_data to already
>->but allocated before anything could be done.
>
>I take it then that you don't have any pointers in your char_data
>structure and that you don't mind loading/saving a lot of useless
>information?
>
>There are a few very good reasons for CircleMUD using
>char_file_u...Unless you'll fread()'ing and fwrite()'ing individual
>fields, you probably need and want char_file_u.
>
>->anyway, I was wondering if there is a better way to do this?
>
>What are you trying to do with that specifically?  Any particular
>reason why you're removing char_file_u?  What exactly is "memory
>correct" supposed to mean, anyway?
>
>-dak
>
>
>     +------------------------------------------------------------+
>     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
>     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
>     +------------------------------------------------------------+
>
>
  +------------------------------------------------------------+
  | "The poets talk about love, but what I talk about is DOOM, |
  |      because in the end, DOOM is all that counts." -       |
  |   Alex Machine/George Stark/Stephen King, The Dark Half    |
  |        "Nothing is IMPOSSIBLE, Just IMPROBABLE"            |
  |   "Easier Said Than Done, But Better Done Than Said..."    |
  +------------------------------------------------------------+


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST