diff --git a/sdk/base/plat_types.h b/sdk/base/plat_types.h index 664b7fe..b475182 100644 --- a/sdk/base/plat_types.h +++ b/sdk/base/plat_types.h @@ -7,8 +7,8 @@ #endif #define SIZE_KB(n) ((n) * 1024) -#define SIZE_MB(n) SIZE_KB(n * 1024) -#define SIZE_GB(n) SIZE_MB(n * 1024) +#define SIZE_MB(n) SIZE_KB((n) * 1024) +#define SIZE_GB(n) SIZE_MB((n) * 1024) #define SEC_2_MS(s) ((s) * 1000) #define MSEC_2_US(ms) ((ms) * 1000) diff --git a/usb/usb_io.cpp b/usb/usb_io.cpp index 7a034d6..4f2ee37 100644 --- a/usb/usb_io.cpp +++ b/usb/usb_io.cpp @@ -98,12 +98,12 @@ async_usb_gadget::async_usb_gadget(std::function threads_.set_exception_handler(excep); unit_in_ = unit_out_ = global_info::page_size; // dev_->get_max_packet(); - // allocate 10MB for IO + // allocate 1MB for IO #ifdef MEM_POOL - io_buf_ = new dyn_mem_pool(256, unit_out_); + io_buf_ = new dyn_mem_pool(SIZE_MB(1) / unit_out_, unit_out_); utils::to_log(LOG_LEVEL_DEBUG, "Prepare %u(%u * %u) for IO.\n", io_buf_->count() * unit_out_, io_buf_->count(), unit_in_); #else - for(int i = 0; i < SIZE_MB(10) / unit_out_; ++i) + for(int i = 0; i < SIZE_MB(1) / unit_out_; ++i) { dyn_mem_ptr buf = dyn_mem::memory(unit_out_); if(buf)