Example #1
0
static void xms_helper_init(void)
{
  int i;

  if (!config.ext_mem)
    return;

  LWORD(eax) = 0;	/* report success */

  if (config.xms_size)
    return;

  config.xms_size = EXTMEM_SIZE >> 10;
  x_printf("XMS: initializing XMS... %d handles\n", NUM_HANDLES);

  freeHMA = 1;
  a20_global = a20_local = 0;

  handle_count = 0;
  for (i = 0; i < NUM_HANDLES + 1; i++) {
    if (handles[i].valid && handles[i].addr)
      xms_free(handles[i].addr);
    handles[i].valid = 0;
  }

  smdestroy(&mp);
  sminit(&mp, ext_mem_base, config.xms_size * 1024);
  smregister_error_notifier(&mp, xx_printf);
}
Example #2
0
int commands_plugin_inte6_done(void)
{
	if (!pool_used)
	    return 0;

	LWORD(ebx) = BMEM(retcode);
	if (BMEM(allocated)) {
	    com_strfree(BMEM(cmd));
	    lowmem_free((void *)BMEM(pa4), sizeof(struct param4a));
	    lowmem_free(BMEM(cmdl), 256);
	    if (BMEM(quit))
		coopth_add_post_handler(do_exit, NULL);
	}
	pool_used--;
	if (!pool_used) {
	    int leaked = smdestroy(&mp);
	    if (leaked)
		error("inte6_plugin: leaked %i bytes, builtin=%s\n",
		    leaked, builtin_name);
	    lowmem_heap_free(lowmem_pool);
	}
	return 1;
}