lawrancej / CompilerKit

Compiler construction library in C.
GNU Lesser General Public License v2.1
55 stars 33 forks source link

Make EmptyString a singleton #29

Closed lawrancej closed 12 years ago

lawrancej commented 12 years ago

EmptyString currently allows multiple instances, which is wasteful of space. We only need one instance of emptystring.

  1. Modify compilerkit_empty_set_new so that it statically allocates a single instance of that object, which it returns.
  2. Modify compilerkit_empty_set_dispose so that it doesn't bother to deallocate the instance.
lapatink commented 12 years ago

I got this.

lawrancej commented 12 years ago

This one will be a cakewalk now. :-)

lawrancej commented 12 years ago

Saw your latest commits yesterday. Thanks for fixing this, Kyle!