flightaware / speedtables

Speed tables is a high-performance memory-resident database. The speed table compiler reads a table definition and generates a set of C access routines to create, manipulate and search tables containing millions of rows. Currently oriented towards Tcl.

Home Page:https://flightaware.github.io/speedtables/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

size for shared-memory table is documented as required, but is not actually enforced

bovine opened this issue · comments

http://speedtables.sourceforge.net/ch08.html documents that the "size" argument to the "create" command is required, however it does not actually appear to be. If you do not specify it, then this default is assumed:

./ctables/ctable.h:#define DEFAULT_SHARED_SIZE (1024*1024*4)

From ctables/template.c-subst:

                    if(raw_size) {
                        if (!parse_size(raw_size, &share_size)) {
                            Tcl_AppendResult(interp, "Bad size, must be an integer optionally followed by 'k', 'm', or 'g': ", raw_size, NULL);
                            goto createError;
                        }
                    } else {
                        share_size = DEFAULT_SHARED_SIZE;
                    }

Either the documentation is wrong, or the code is wrong.

The documentation is wrong, I'll fix it, unless you have a good reason for going the other way.

okay, that sounds fine.

I've committed a fix to the documentation.