view Renderer/Engine/task/DataAllocate.cc @ 1813:d7973604e81f draft

fix memin size
author kkb
date Thu, 12 Dec 2013 18:34:16 +0900
parents 95b114c66e14
children
line wrap: on
line source

#include <string.h>
#include "DataAllocate.h"
#include "Func.h"

/* これは必須 */
SchedDefineTask1(DataAllocate,dataAllocate);

static int
dataAllocate(SchedTask *s, void *rbuf, void *wbuf)
{

  long count = (long)s->get_param(0);
  for(long i=0;i<count;i++) {
      void *idata = s->get_input(rbuf, i);
      long size = (long)s->get_param(i*2+1);
      long load_id = (long)s->get_param(i*2+2);

      void *buff = s->global_alloc(load_id, size);
      if (idata != NULL) {
	memcpy(buff,idata,size);
      }
  }

  return 0;
}