On the ESP8266 the int variable is 32 bits long and not 16 bits. Better to use something like uint16_t instead of int so your sure of the variable size.
The setWholeBuffer function might be causing the WDT reset because it's not yielding control for the core to perform housekeeping. Try putting a delay(1) or yield() within the for-next loop.